package com.kwq.file.service.Impl;

import com.kwq.file.dao.FileRepository;
import com.kwq.file.pojo.File;
import com.kwq.file.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class FileServiceImpl implements FileService {
    @Autowired
    FileRepository  fileRepository;

    public File save(File file){
        File save = fileRepository.save(file);
        return save;
    }

    public void deleteByName(File file){
        fileRepository.deleteByName(file.getName());
    }
    public List<File> selectAll(File file){
        List<File> all = fileRepository.findAll();
        return all;
    }

}
